// 接口：用来定义对象的数据类型
interface Person {
  name: string;
  sex: string;
  money: number;
  isMarry: boolean;
  age: number;
  readonly id: number;
  home?: boolean;//可选参数
}

const person: Person = {
  name: "小可爱",
  sex: "18",
  money: 999999999999999,
  isMarry: false,
  age: 18,
  id: 999,
  home: true,
};



interface P {
  name: string;
  age: number;
  child: Child;
}

interface Child {
  name: string;
  age: number
}

const p: P = {
  name: '华哥',
  age: 18,
  child: {
    name: 'bang',
    age: 18,
  }
}

const nidaye: Child = p.child
console.log(nidaye);
